implement naive spanning system