modified code to use vector
updated code and readme