Further work on the main code
Further work on the main code