Implements push and peek.