Heat transfer and work done