Finished commenting code. Starting to optimize running time.