refactored for proper installation, testing with travis