implement stack correctly, working for up to 2 by 2