its not identical where it gets printed. the idea is to have the current x,y value and the previous one, thats why its called px,py... so they are the same at the beginning, but right after that x,y gets changed. then they use x and px to calculate the distance between the position and the previous one to get the circle size and make them touch each other...
regarding your second question, there is no reason not to use mouseX and mouseY instead of targetX,Y... maybe easier to read thats why...