creating main functionality