Initialize variables
Refactor: Replace malloc buff with std::vector