started assignment1 task 5, rewriting match methods