Refactored, executes in 0.24s