Fixed if-then-else syntax, then is optional unless it's a one-liner
Created list partitioning algorithm in Ruby