Refactored program to use instruction stack, see Main.hs