adding comments and fixed goal cost bug