use labs(long)  for abs(long), since for some platform abs(long) is not defined