More main changes. Added smoothing and voting, working on output