Improved memory handling

included readme