distance for com, finished!!