Testbed code for 4th year project