improved input handling and removed redundant wall/door code