Added comments and mode argument