RTC integration with Arduino MEGA

Can't see where you are doing this in your original code?