added function to fix dodgy contracts, more front end work