working version: compared both triangular & analytical solution