Finished distortion algorithm and added first test example.