some refactoring, added dat.gui