Add ; command to switch stacks
Fixed errors, optimized code