Scratch Implementation in Python