added sum square difference