modification for return calculation