implemented normal equation