changed some comments/messages, minor refactoring.