tidyed up a bit