minor bug and comments resolved