various bits of code