modified for loop to use var in compliance with use strict statement
Updated vector rotations and added Z rotation. Change input behavior