Completed code for Calendar