Add stdlib import for 'abs'
Remove unneeded switch statement