First round of code, should be basic functionality, needs debugging (probably)