Fixed 'input' function and improved code documentation