Using empty UNO board to program external ATmega328

i am new to the whole arduino controller, but so far i enjoy it. So i can remove my ATmega328 from the UNO board and put it onto a bread board with my program loaded onto it and add the crsytal and two capacitors and have it work just like the UNO would work? Thank you