added test
refactorization of code, style display