added integral, now it is a PI controller