fixed storing data to memory. addition is still suffering problems though