Finished both functions