developing the main functionality