The license is missing. Also, where does this code come from? Have you used a reference implementation to draw inspiration from? An article? A tutorial on the internet?