Make the pattern painter work

Add more debug too