Code is messy but it works flawlesly.