added minbar calc back in