added method to ray