Used len() and the already created functions that implements caching instead