working version, labels fixed