Cleaning code and commenting