Better version of #9