make it robust a little by adding argument checks, etc.