work out all the bugs