fix angle calculation