tons of rewrite and gui code