untangling io from logic
working on drain functionality