Fixed up last part of code