updated version (matches flex)