lot's of stuff going on here, including broken Math.cos()?