Added function comments, changed "list" type to "array".