Changed some functions to properties for precomputing