V2 finished tidy code