Changed tabs to spaces, added licence, and added newline before function brace