added compute method