moved key functions to keys.js