This was my first js widget - early 2012 code