Also a nicer way to do it, will do when I refactor.