getOffset method added (fixes #12)