added engine and fixed other issues