still having issues on the target function