almost done with first working solution