What's wrong with my permutation logic? The given question:

In how many ways the letters of the word RAINBOW be arranged, such that A is always before I and I is always before O.

I gave it a try and thought below:

Letters A, I and O should appear in that order. Then there are four places in which all the remaining four letters can appear. It means there are a total of 16 places: $$*_1*_2*_3*_4\quad A\quad*_5*_6*_7*_8\quad I\quad*_9*_{10}*_{11}*_{12}\quad O \quad *_{13}*_{14}*_{15}*_{16}$$ 
  Out of these 16 places remaining, the letter can appear in any of the 4 places, giving total $^{16}P_4 = 43680$ possible arrangements. 

But the given answer is just 840 with following explanation:

All the 7 letters of the word RAINBOW can be arranged in 7! ways and 3 particular letters (A,I,O) can be arranged in 3! ways. But the given condition is satisfied by only 1 out of 6 ways. Hence required number of arrangements 
  $$=\frac{7!}{3!} = 840$$

So what's wrong with my logic? I must be counting certain arrangements multiple times or my logic must be at fault in large. But what's that exactly?

You would be entirely correct if there really were 16 places ( 19 in all ) and the places not filled with letters were filled with spaces so that
R***A****I*N*BO**W*

was truly distinct from 
*R**A****I*N*BO***W    ( I has used * because spaces are hard to count )
what $ ^{16} P _4$ counts is the number of four-tuples with non-repeating elements from 1 to 16. 
You might have the first element represent the position ( in your scheme of 16 positions ) of the letter "R" and the other three the positions of "N", "B", and "W" respectively.
so that  R***A****I*N*BO**W* would be represented as (1, 10, 12, 15)
and *R**A****I*N*BO***W would be represented as (2, 10, 12, 16) . 
