Adding listeners to input fields and next button under AlgorithmVisualizer