initial attempt
added conditional templating and proper binding. more work to do