compeleted the function to compute size k co-locations