now implemented stacking functions and loops correctly mostly. some things are still not right