adding libraries and some editing