Updated Autofind, and cleaned up some code