Simplified code for variable stack