basic logic seems to be working, grading has bugs