Refactored the input code and working on adding renderer.