built most of functions
documented functions