Cleaned everything up by putting it in a struct