Final ver. of code is v5. Just made it easier to read.