added shadowcasting algorithm