The code for my third year project