Big update, still needs better testing