added isEmpty functionality
had to refactor a lot of things along the way
refactored to one single method for adding elements in the three
simplified nested if statements
Merge pull request #8 from mathiasverraes/isEmpty

added isEmpty functionality