add customisable initfunction