A factory has eight machines available but only three spaces on the floor for the machines to be placed in the production area. If the order of machines does matter, how many ways can the eight machines be arranged?
a) 24 ways
b) 336 ways
c) 1,120 ways
d) 5,040 ways