Rewrote a bit. Just use std::string instead of char arrays