Written tests.
Made cache via def instead of val.