fixed ALL THE BUGS... minus one. 'doh.