Added some changes, currently in a state of infinite loop

but I think it's supposed to be like that. I think we're close to
finishing.