My toy code (Python)