updated bad code practices