Fix #30 by importing numpy inside function