got basic functionality working but more to add and refactor