added parseFloat to user-inputted values and cleaned up event listener code