a little bit more comments documentation and making temporary array init zero