updated library class. Doesn't work yet.