Working Version
working version but no clustering