Update to final code