Incorporated Gershom's changes