Updated code, minor changes