Det är inte det mest optimala, men det funkar:).