Code from my first year assignment