Version2

Fix some warnings and add comments