memset instead of stupid loops