refactored, lines are passed down from main method now
merged
added constructor