Added utility functions and Vector class