modified for effciency