More pleb-tier work. GCC warnings but it works