major implementation part