All the code up to this point