Closes #11 (Smarter histogram generation)