Seems to work
heavy debug still required