Getting the code to work