minor speed improvements
removed linear cache
minor changes to improve the performance