Major addition and fixes