The only cost difference in building a 318 vs a 340 is pistons. Where you achieve the 400 HP is a matter of what camshaft is used. There is a lack of torque due to the smaller CID of the engine. In order to match a larger engine, step up 1 gear ratio. 4.10’s - 4.30’s.