finished and integrated reflect function