[#014] First steps - introducing simple stack-like data structure, simplifying the code + small bugfix.