it now works with 32bit keys
many small changes. still doesn't work
python script to solve the same thing for comparison