refined code to be used for t4e into Amazon.py