complete K-means portion of assignment