tests now done, some bugs with memory