- adding doc comments to library functions
- replace loop with iterate for kmeans