half-correct Python code for Ashu to improve