Homework code for operating system