adding challenge from the morning, needs refactoring but works