modified clustering code to feed from database & started on keyword code