fixed bugs, added demote, changed push semantics