Questions answered by dan, some random code floating around