Cleaned code to new style, alignment for arrays and renamed permission to underscore.