major update, more efficient