Final version before debugging