proof of concept, contains dead code
helper functions