Added function definitiions