You code does not provide the values of A_star and A_ratio, which makes it difficult for testing your code (Please read: make it easier to help you)
You code does not provide the values of A_star and A_ratio, which makes it difficult for testing your code (Please read: make it easier to help you)