adding shared functions