Added compute max deviation