Re-factored model selection. Unstable and buggy commit. =P