updating lib & adding tests