coutn function
fixed stupid error in distance function [!]