Update complete.R

Added comments and tests. final before attempting submit.