Merge all of dan's last minute hacky changes :)