Converted into a package
Separated tests from main function