further refactored input by adding getDelta method to increase encapsulation