added some gradient based analysis