edit pysudo code to work fo sho