Updated addEventListeners function to parse integers