Removed some useless and confusing code