add some comment headers, start to define some functions