Cleaned up code, written summaries