Modified to work as my template