Initial commit, feel free to do a pull request if you have found a bug.