added rescaling, comments and stuff