Initial add of Paul's updated rtc code