Ported over latest updates from previous project