Changed Main according to Guy's changes.