removed duplicate function