Editted with new onChange method by Douwe de Haan