Added math to countoixel