Replaced vector math using OOP code