implemented all methods to pass test