debugged a star and refactored some code