Added Rate and sleep functions (needs reworking)