add function
using add function where appropriate
a few updates
done function
some error formating
some update