During this season of giving, you can show your support for the NTP Project by making a donation to Network Time Foundation.
The next step in clock algorithms is to understand what already exists. For that purpose, you should study and thoroughly understand the phase-lock-loop algorithm that was in the original recipe of NTP, and the frequency-lock algorithm that you can find in my papers and that was included in NTP starting with the first version 4, as I remember. Almost all of my papers are on line at the publications menu on https://tf.nist.gov. If you enter my name you will see a listing of all of my papers. The earliest one that is important here was published in about 1995 in the transactions on networking. That paper introduced the frequency loop principles. For background information, you could also look at my review article that appeared in the Review of Scientific Instruments in 1999. A lot of this stuff is also in David Mills' book, and there is probably lots of other stuff out there that I don't know about.