Removing erroneous code