rewrote assignments using Python