Simplified input handling for lb_main.py

Thanks to a suggestion by dingo, I was able to reduce overhead in the input handling code.