updated with bad coding practices