Updated tests to represent what happenes better + some code updates