Updated stiffness func

Restructured stiffness func and added in quad weight