added angle calculation