rtc_DS1307 updated, main.c restructured