cleanup, reformat, return results,err instead of just err, couldnt find a use for pending field, removed