Merged all into a single standalone python script