tidying up libs
bug fixes