added keydown function and storage array