bug fix and debugging statements.