Source Code for day4 and homework