added arrow key support
fixed up more indenting derps from original code