Correct format, add tests

Replaces tabs with spaces and added some tests for this pull request