linear solution added(without testing)