Updated order() function to allow buying