Updated main_dev to be more efficient