Minor fix (setting variable direction1 and direction2 to initial value)