this is not finished but it does work