more comments. refactored to OO approach.