slightly less idiotic approach