Refactored with help from the obelisk guy to make lots of speed.