add functions for ex.2b