completed all functions

TODO: fix case where all true or all false