Main Code Updates (Few Bugs Left)