Useful code for my exam in January