Bughunting,

the order of repositioning and checking for visibilty of phase lines was wrong