refactored to get main function to work
Merge remote-tracking branch 'origin/master'