fixed bugs with numpy