compiles and now in a better structure