updated to incorporate changes mentioned in flint-devel