updated with functions.. Redoing for final draft