Formatting and small tweaks

Formatting, spaces to tabs, self invocating function and more