Initial commit

V2:
-Ported from SDK 1.x.
-Improved efficiency of algorithm and code.
-Lessened resources.