made some updates to keywords function