Remove warnings and add comments