refactoring

using for comprehensions where possible
refactoring
modified package structure

refactoring, replaced println with assert when answer is known