Fixed bug with title label
Added more code to control memory