updated comments and added tests
merged