This code id finalised to be used for further development