added chi squared return value