Michael's Fixed Code