Replaced arrays with objects

Representing vectors with objects now instead of arrays.