better naming convention for sort
fixed code analysis issues