Improvements to memory efficienty
Minor updates for testing