Adding code I already had written.