Revision 2: modified func. def.