Add comments  and fix erros

Add comments and fix errors