Added final cleanup commands, renamed some variables