initialize variables correctly