Refactored code and allow variable # of stars

Change-Id: Ie4bae092dc142b6df041ef119574f7632d6f36ef
Merge "Refactored code and allow variable # of stars"