Removed malfunctioning code