simplified as suggested by #guiness