fast passing test input6 and input8
api compatible with homework and fixes slopeTo and draw functions