fixed incorrect velocity calculations. Main now uses zero_in function