updated
converted to function and included in module