Polished up implementation of Jarvis-Patrick