The effect of external pressure & magnetic field in star formation: The critical mass model