use NUMBER_OF_MODES instead of static 4