Fixed some bugs, improved speed and used a slightly different algorithm. Use with credit. I may make a YT tutorial on this (or a series).