finished refactor, improve sphere intersection, still performs way better in cpu than gpu