less elegant, more efficient