Finished implementing NPI, new features and database improvement