first pass at basic working implementation, should have written more tests first will get test coverage up in a minute.