less clunky offsetMap function for issue #9. still breaks on safari and page loads weird in firefox