fixed bugs in library + wrangled data