Merge pull request #23 from alexandru-iacob/master

Re-structure script - using functions