Added frequency-based coarse type assignment. Removed unused code at frontend.