Got some help from Kosuke|need to set mem bounds