fugly, but mostly working