add and check correct all 3 methods(but last two methods not passed coursera test)