Reworking gnuls function