Updated with some fixes (minor changes at this point)