added linear and staircase functions