switched the order of finding own and target location