fixed test; updated implementation of "exists"  method