formatted the code. In preparation for commenting