Wrote a dithering algorithm that kinda works

I tried to comment everything, so check out the source code to see how
everything works