with feedback from @fent