Initial Lomuto Algorithm, authored by Tim Huynh