Fixed the get angle function