necessary functions