Trying to write more modular code now. Breaking the code up into chunks
corresponding to each step.