add comments
write the functions