cleaned up and reformed library stub.