more work on csv engine and remove debug statement from tail function