Rewrote bonus logic slightly.