testing source implemented, code in need of major restructure.