added initial function code