corrected implemetation of bresenhams line algorithm