changed how the results are returned
fixed some bugs
working