Solution of HorrorStory challenge