Added first version of code for the smart frequency model
Fixed some bugs but still need to test performance