simplified some methods
added constraint - empty list
added new test