made the run time stack better and added the heap