Fixed recordInput to use the temporary data structure