print() and malloc() should be working.  Calling free() causes print() to undergo an infinite loop; possibly something to do with messing up the conditions that inBounds() relies on?