added some functions + comments