added typeout and comments