Fixed the tempVar-1 problem by adding another case statement