reorder definitions
Make code compilable