Update withfunctions.py

properly returns a dictionary from the find_all_instances function and tests the find_all_instances function