added some code to library