Added Variables to keep track of orientation