Final version
Getting near to the final version...
Slight rearrangement