Corrected, and tested :)