adding match statements, objserving function error