removed lin in Rajiv's implementation