updated libraries, adapted code, code cleanup