Update starbuzz.py to use a function