fix elements()
added and refactored more tests