updated output and made nonip x,y calculation slightly more correct