changed gradient projection part