Fix: Changed names of some variables and added comments to some functions.
Also did some minor hotfixes for prints etc.