Reverted to good flex code