Forgot a couple of semicolons. Only explicitly convert the start and end vals to integers if a unit was specified