wrote cache solve with comments