initial commit - working main procedure