Massive cleanup, use numpy