Working out some errors in the code!