removed unused variable tempM