refactored calcTargets logic, updated document