Organized the code abit using pragmas