added a little more debug and some if conditions for the integers