Terrible memory managment, must fix