Small edit to V3 and 4

V3 - extending while loop
V4 - error checking for infinity slope