added necessary functions