Adding key modifier logic