tested trap_mem and grow stack a bit more. Added additional comments