What are the three reasons cells undergo mitosis?