Calculate X