pre refactoring, works with a switch
refactoring: drawing works, preview doesn't