Added input validation

Make sure the user enters in a long enought vector.