Fixes to lib, updated README (needs formatting)