Started integrating ratchet
Minor modifications