Add comments, cleanup, fix CS.