How many arrangements of a bookshelf exist where certain books must be to the left/right of other books? The question at length is exactly this:

There are five distinct computer science books, three distinct
  mathematics books, and two distinct art books. In how many ways can
  these books be arranged on a shelf if one of the mathematics books is
  on the left of all computer science book, and another mathematics book
  is on the right of all the computer science books?

I have searched a ton online for a question that's even similar to this but have yet to find one. Most examples have set groupings of books to create an 'object' but none have the kind of modular specifications of this question.
I realize that there is ambiguity about if the math books are directly flush with the computer science books, or if they can be 'anywhere to the left/right' of the computer science books. I've attempted this question under the more challenging assumption and have gotten an answer as follows:
There are 4 different placements of two math books that will allow for the computer science books to be completely between the two.
1) 8 spaces between the two math books M__________M (1 way)
2) 7 spaces between the two math books: M_______M_ and _M_______M (2 ways)
3) 6 spaces: M______M__, _M______M_, __M______M (3 ways)
4) 5 spaces: M_____M___, _M_____M__, __M_____M_, ___M_____M. (4 ways)
Then I wanted to find the permutations of each of the ways above by the Rule of Product, and add them together by the Rule of Sum to get my final answer.
(1) 8 spaces: P(3, 2) * P(8, 8) 
[Delimiting math books]  * [permutations in between]
(2) 7 spaces: P (3, 2) * P(3, 1) * P(7, 7) * 2
[Delimiting math books] * [Options for book outside of delimitation] * [Permutations in-between] * [number of ways to achieve 7 spaces]
(3) 6 spaces: P (3, 2) * P(3, 2) * P(6, 5) * 3
[Delimiting math books] * [options for 2 books outside delimitation] * [permutation in-between] * [number of ways to achieve 6 spaces]
(4) 5 Spaces: P (3, 2) * P(3,3) * P(5, 5) * 4
[Delimiting math books] * [options for 3 books outside delimitation] * [permutation in-between] * [number of ways to achieve 5 spaces]
Then my final answer would be (1) + (2) + (3) + (4). My worry is that I'm missing some duplicates somehow.
Also conveniently, I believe the total for 5 spaces would satisfy the simpler question if it is actually referring to permutations with the chunk MCCCCCM.
Thanks in advance! I'd love to see specifically what I'm doing wrong (if I am indeed wrong).
 A: Here is an approach that avoids using cases.
Set aside the art books for the moment.  We will place them later.
We have to arrange the five distinct computer science books and three distinct mathematics books so that there is at least one mathematics book to the left of all the computer science books and at least one mathematics book to the right of all the computer science books.  We have three choices for which mathematics book will be placed on the left end of the row and two choices for which mathematics book will be placed on the right end of the row.  We now have six books (five computer science books and the remaining mathematics book) to arrange between the mathematics books we have placed at the ends of the row.  We can arrange these six books in $6!$ ways.  Hence, there are $3 \cdot 2 \cdot 6!$ ways of arranging the mathematics and computer science books.
We now have nine spaces (seven spaces between the eight books we have already placed and the two ends of the row) in which to place the first art book.  Once it is placed, we have ten spaces (eight spaces between the nine books we have already placed and the two ends of the row) in which to place the second art book.  Hence, we can arrange five distinct computer science books, three distinct mathematics books, and two distinct art books so that at least one mathematics book is to the left of all the computer science books and at least one mathematics book is to the right of all the computer science books in 
$$3 \cdot 2 \cdot 6! \cdot 9 \cdot 10$$
ways. 
A: There are $10$ places to put a book. Place the art books in one of $10\cdot 9$ ways. 
Now we order the remaining books, which then go onto the $8$ places left empty so far: We can order the five CS books among themselves in $5!$ ways and the three math books among themselves in $3!$ ways. Put $M_1$ to the left of the CS books and $M_3$ to the right of the CS books. Choose one of the $6$ slots so created for $M_2$.
In all there are
$$10\cdot9\cdot 5!\cdot 3!\cdot 6=388\,800$$
possibilities.
A: (10!/8!)*(5!3!)*6_____ must be the answer.
First consider selecting 2 out of 10 positions on the shelf. This can be done in 10C2 ways. 
Now keep the two art books on these two positions. These art books can be shuffled in 2! ways in these two positons.
We can keep the maths books on the remaining 8 positions on the shelf in 6 ways___ the first and the last positions in serial order with respect to the shelf must always be assigned to two maths books, and the third maths book can be kept on any of the remaining six positions out of the eight positions. 
This is because if we consider these eight positions in serial order, the five computer books must always be in between two maths books, which means that there must be a math book on both the extreme positions.
Once we have assigned the positions to books of different subjects, we can shuffle them in 3! * 5! ways, This is because the maths books can be shuffled in 3! ways and the computer books can be shuffled in 5! ways.
Thus total number of ways are ( 10 C 2 ) * 2! * 6 * 3! * 5! = (10!/8!)*(5!3!)*6
However, if the maths books which are to be kept on the extreme positions are already decided, then there would be 6! ways to arrange the remaining six books. In that case answer would be 
10!/8! * 6! = 10*9*6!
A: Converted to "just before/after" approach


*

*Take out $2$ math books as well as both the arts books in $\binom32 = 3$ ways.

*Permute the remaining $6$ in 6! ways

*Insert $2$ math books just before/after computer science books in $2$ ways.

*Insert the arts books successively in gaps (including ends) in $9\cdot10 = 90$ ways
$\qquad 3\cdot6!\cdot2\cdot 90 = 388,800$
