Changed from nested switch to nested if (faster)
Ahhh, much faster :)
Added a readme and an example