Added another version of third order with better algorithm