added functions and 2nd story