Updating Library

Library now is more generic and hopefully easier to use. Updating example to follow.
updating sample project