both functions are finished