documented several functions
macro resolving goes on. macros will be commented out with // and the
equivalent code will be added below