whole bunch of changes and bug fixes as per rachaels email 28/8