Adds code for Steps 1-3