updating ratchet example to simplify and divide process