fixed michaels bad code