Made functions init and calc