Got a basic python version working. Slower than C but hopefully can improve that