Gavin's build with some fancy stuff added in, partially finished so some performance issues.