Changed py code