Moved declarations and macros
Finished previous commit