impemented the two methods as requested