Stars code has been refactored. Credits added