added Observer pattern to Input class