An ideal gas's initial conditions are 1 mol, a pressure of 271.7 kPa, an internal energy of 624 J and a volume of 0.8 L. The gas is allowed to expand quasi-statically at constant pressure to a volume of 6.9 L. It is then cooled at constant volume until the pressure is 100 kPa. What is the work in joules done by the gas?