Added Calendar functionality and improvements on existing code