fixed bug where memory was written to after it was free'd
updated readme