replaced super inefficient ancestor() function
made testing script names more consistent
still buggy