refactored and pulled into different functions
refactored js into separate methods
Merge pull request #1 from kmazanec/expand_functions

Expand functions