latest work, still needs a cleanup but working great