working version of numerics