Tweaked code

Played with code. Angle doesn't seem to be calculated properly at the
moment.