modified for direct use