updating both functions