implement all of function 
day 12
day12