changes made for readability of code and further adding of tad