added notes and fix warnings.