added mean and error
fixed minor issue