Tried to change it to the numpy way of doing things