ran into some brutal c issues