Speed up

Introduced cached variables