scide: fix line evaluation of final line & clean up implementation