Broke down into steps for easier understanding