Code form Damjan Vujnovic's advanced javascript workshop