fixed bug in tf-idf ranking, renamed metadata function