Modified the program so it works with vectors
Bug fix