The main code for our honours Project