Fixed convolution error, added coordinates and distance variables