Code from my final year project