comments and redundant code lines removed