Add full code, fix heap overflow