Malloc removed and condition replaced