put some syntactic sugar in it, and added stuff to my sensitivity list to properly do waht stuff is supposed to do. Also, I added some comments in the code to make my code more clear