Adds test to sieve function
Refactoring and more refactoring