A cylinder is fitted into a piston chamber containing R-134 refrigerant at 100°F, 80% quality, and at a volume of 3 gallons. An external force is applied to the cylinder in such a way that the R-134 slowly expands in a polytropic process up to a pressure of 50 lbf/in² and a temperature of 80°F. Calculate the work and heat transferred during this process.