Clean up and add comments