Changed computation of gradient and stuff - however, something is shifted or so...