bogosort using a singleton method