Added memory handler to main...Again