Added error calculation