generating a random 2 or 4 after every keypress