#16, #17 Implemented clasterization algorithm