Almost rewrote BD2.Core