Some random algorithms in Vala