Add comments and some other minor changes