Reformatted indentations etc.
Added setting z-position from vector direction and made perspective nicer when rotating screen.