merging with hall's version