refactored retrieve.py. much easier on the eyes