add include header and use std::round
use plain array instead of std::map