Cleaned up library, removed superfluous code, added to example