initial commit

both functions implementation