tested and fixed some bugs, streamlined areas of the code.