+ added sorted flag
+ renamed some #defines (might break some code)
+ added test sketch