Previous revision had A LOT of unecessary code.. Fixed that now