Codes moved to appropriate location and reformatted to use spaces instead of tabs