removed linear cache
minor changes to improve the performance