Added the first test. Improved the code flexibility... but not tested at all O_O. Be patient.