Solving for volume of rectangular prisms