Updated main code and added addressing stuff.