fixed bug in abs function