porting quote script to python. the script is not complete yet