Turning heat into electricity