checked first five problems, fixed bug in problem5