added the necessary functions