Adding some changes. Logic is still not even near to what it should be.