first implementation of modes