PE78 solved - algorithm improved 2