code opgekuist
possibility to set demag off
added comments