changed test code
removed unnecesarry code
added some comment
changed formatting