added libraries and clean up