implemented more changes from review #117