Added scoring support + Reorganized code