Final version with multiple targets