Added critical density computation