changes to add clustering too