Implemented interrupt for calculation and outputs