added zeroing code