Add comment, organize functions