better, but still hacky