Added basic framework for clustering... (WIP, causes some errors)