use stack to keep track of sections