initial histogram building