Somehow working solution