added memsets for initializing memory