Added detection of the critical point