refactored for cleanliness ; added editPass