Cleaned up interface, added example and test