removed false if(!pointer), replaced them by if(pointer)