Added modular offset functions