implemented problem003 and testing