writing code to process angular distribution