Added key listener and changed layout of panel.

Rearranged some things.