Refactored print stars recursively.