Added comments to key input functions