Fixed spaces/tabs and updated up the code bit to make cleaner patch