Not pretty, but it gets the job done