Add comments and some debug messages