touch ups on py file small Algorithm