Try to import numpy only once

Would love to get criticism of this code. Also, how do I test it?