Got the code fixed with a little help from Wil