Did a bit of playing and sorting some of the code out. The level gen
still doesnt work just crashs.