update from r12a's suggestion