Functions written

Basic required functionality completed.  Comments and error handling to
do.