Updated lib to make it easier to use