fixed cond, understand line 56 now, and added more comments