small changes
added vector
simplified code