Thanks for this! Would be nice if there was a complete tutorial on how to implement it for total noobs like me :p
Please read the comments provided in the code of the controller object, it's all explained in there!