fixed off-by-one errors in problem 19 script