Made clustering algorithm selectable by user.