made input storage responisbility of class and added input instance variable.