longer but saner code, OK