More formatting fixes
Make code more readable, replace malset with calloc