edited output to correctly reflect criteria