Cleaned up method of adding rank column and added more comments. This was done after I submitted my hw but before the deadline.