Bug fix: Valid target function now works correctly
Bug fix: Valid target function now works correctly, remove junk code