Up until the last couple of weeks I have been focusing on fat loss, but now that I'm getting closer to a healthy weight, I am starting to focus more on fitness and toning up/building muscles. So what do i need to do nutritionally to ensure that I both gain muscle and lose fat? Can I still run at a caloric deficit (usually I run at about a 500 calorie deficit) but build muscle by making sure I eat enough protein?

Thanks!