Fixed bugs and added Fermat’s little theorem.