Wrote body of the two functions