made the get-all-cpts-of-nodes function MUCH more idiomatic :)