Organized fitBMA code