http://codepad.org/DO0Yq0CS
http://codepad.org/jmDGu9SR