updated to account for zeros, which was the next problem