Added key input

Also Min Max functions