I can't figure out if the error is in the code or the engine

certainly