added a vector class to clean up layout code