Added functionality for calculating the error, just weight adjusting to do before testing