Cleaned up function summary and debug comments