Add debug functionality, move header to the top