Finished code for day 4