Code from SYS6021 (authored by professors)