updated function to get correct velocity array

The x velocity was wrong each time by a factor of -1. This change fixes that.