Added memory limitations and wrapping. If the program exceeds mem it now blue screens and stops executing and clears memory.