some changes that I made earlier. starting all from the beining