implemented linear classification