Fixed the problems with the previous thing, this will be a bit tricky...