need more comments on the code, now is very unclear