Add comments, fix problems and some features