updated libraries, adapted code
updated libraries