Re-implementation

Essential stuff that was lost in rollback is now back.