remove invadid variables
added more tests