changes to ia to stop segfault and eat less