Cleaning code and adding comment