My Initial working solution;