Investigating Yang-Mills theory and confinement as a function of the spatial volume