core implementation complete. As of yet, non-functional. negative distance errors, and null pointers. not elegantly implemented