updated libraries, adapted code, small cleanup
updated libraries, adapted code