An implementation of the malformed stack