Cleaning up the code a little, fix indentation

Until now the code had mixed tabs and spaces. Those have been fixed.