419 still needs debgging but close enuf