Refactored (made it a lot cleaner)