Full code review

Full code review
Renamed the function for more clarity