make engine an interface and add documentation