changing to add clustering functionality into flask