Some fixes, added comments.