refactor functions from recommtest1.py to recommendations.py