Fixed int rounding issues by using double throughout calculation and converting back at the end. Added some functionality to Vector class in the process