Found bugs, and changed the names of variables