add specifications for each function and comment some testing code