Maya aim matrix & joints

Not sure if you already had a look, but a while back i had similar issues trying to figure this out.