This code doesn't work and there's a lot of debugging to be done, but it's a start...haha