using vectors instead of list