init, working version