added simple stack management, not working perfectly yet, have to go :P