add p, d and s arrays
find capex of the cycle