Engine written by Kevin Suffern and adapted for personal use