Adds offset util function
Clean up source