Copy pasted the code that Pelo made