2014.11.11: wrote two functions

still need to add comments