Changed some bad code