Removed redundant code. Added more comments regarding processing for
each step.